<div class="row">
	<div class="col-lg-12">
		<h1 class="site-h1" style="background-color:#FFFFFF;">
			用户列表<#if userList??>（${userList.totalElements!''}）</#if>
			<span style="float:right;">
				<button class="layui-btn layui-btn-small green" href="/admin/user/add.html" data-toggle="ajax" data-height="450" data-width="750" data-title="创建新用户">
					创建新用户
				</button>
			</span>
		</h1>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12">
				<table class="layui-table" lay-skin="line">
				  <colgroup>
						<col width="30%">
						<col width="15%">
						<col width="14%">
						<col width="7%">
						<col width="7%">
						<col width="7%">
						<col width="20%">
						<col width="1%">
					<col>
				  </colgroup>
				  <thead>
					<tr>
					  <th>用户</th>
					  <th>电子邮件</th>
					  <th>手机</th>
					  <th>省份</th>
					  <th>城市</th>
					  <th>管理员</th>
					  <th>注册时间</th>
					  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
					</tr> 
				  </thead>
				  <tbody>
					<#if userList?? && userList.content??>
					<#list userList.content as user>
					<tr>
					  <td>
							<a href="/user/index/${user.id!''}.html" target="_blank">
								<img src="/res/image/${user.id!''}.html" class="ukefu-admin-avatar" onerror="this.src='/images/user/default.png'">
								<div style="margin-left:50px;margin-top:0px;">
									${user.username!''}
									<div style="color:#aaaaaa;font-size:12px;">
										<#if user.lastlogintime>
										最近登陆：${user.lastlogintime?string('yyyy-MM-dd HH:mm:ss')}
										</#if>
									</div>
								</div>
							</a>
							
					  </td>
					  <td>${user.email!''}</td>
					  <td>${user.mobile!''}</td>
					  <td>${user.province!''}</td>
					  <td>${user.city!''}</td>
					  <td>
					  	<#if user.usertype?? && user.usertype == "0">
					  		<i class="layui-icon" style="color:#19a55d;">&#xe618;</i>
					  	</#if>
					  </td>
					  <td>${user.createtime!''}</td>
					  <td style="white-space:nowrap;" nowrap="nowrap">
					  		<a href="/admin/user/edit.html?id=${user.id!''}" data-toggle="ajax" data-width="750" data-height="450" data-title="编辑用户信息">
					  			<i class="layui-icon">&#xe642;</i>
					  			编辑
					  		</a>
					  		<a href="/admin/user/delete.html?id=${user.id!''}" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否删除记录？">
					  			<i class="layui-icon" style="color:red;">&#x1006;</i>
					  			删除
					  		</a>
					  </td>
					</tr>
					</#list>
					</#if>
				  </tbody>
				</table>
			</div> 	   
		</div>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12" id="page" style="text-align:center;"></div>
		</div>
	</div>	
</div>
<script>
	layui.use(['laypage', 'layer'], function(){
	  var laypage = layui.laypage
	  ,layer = layui.layer;
	  
	  laypage({
			cont: 'page'
			,pages: <#if userList??>${userList.totalPages}<#else>0</#if> //总页数
			,curr:<#if userList??>${userList.number+1}<#else>0</#if>
			,groups: 5 //连续显示分页数
			,jump:function(data , first){
				if(!first){
					location.href = "/admin/user/list.html?p="+data.curr ;
				}
			}
	   });
	});
</script>